﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true"
    CodeBehind="Details.aspx.cs" Inherits="MVCClubSite.Web.Views.Albums.Details" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div id="leftcolumn">
        <div class="contentblock">
            <h2>
                Album: <%= ViewData.Model.Album.Title  %></h2>
                <%= ViewData.Model.Album.Description %>
                <br />
            <%= Html.ActionLink("Edit Album", "Edit", "Albums", (object) new { @id = ViewData.Model.Album.ID }, null) %>
            <h2>
                Photos</h2>
            <% using (Html.BeginForm("ImageSelected", "Albums", new { @id = ViewData.Model.Album.ID }, FormMethod.Post))
               { %>
            <div id="photos">
                <%foreach (MVCClubSite.Model.Image i in ViewData.Model.Images)
                  { %>
                <% if (i.ID == ViewData.Model.SelectedImage)
                       Response.Write("<div class='selectedalbumphoto'>");
                   else
                       Response.Write("<div class='albumphoto'>");
                %>
                <%= "<a href='/Albums/Details/" + ViewData.Model.Album.ID + "/" + i.ID +"'>"+Html.Image("~/Images/ThumbnailImage/" + i.ID) + "</a>" %>
            </div>
            <% } %>
            <div class="clear">
            </div>
        </div>
        <% } %>
    </div>
    </div>
    <div id="rightcolumn">
        <div class="contentblock">
            <h2>
                Selected Photo</h2>
            <% if (ViewData.Model.SelectedImage != 0)
                   Response.Write(Html.Image("~/Images/LargeImage/" + ViewData.Model.SelectedImage) + "<br />"); 
                   %>
        </div>
    </div>
</asp:Content>
